In a detecting device for detecting positions of a table and a motor of a machine tool of an NC apparatus, a rotary-type pulse encoder attached to the motor shaft or the like and a linear-type pulse encoder attached to a worktable or the like are known as means for detecting the movement and moving speed of a moving body. As the moving body moves, these encoders generate an A-phase signal, a sine-wave signal (Ksin .theta.), and a B-phase sine-wave signal (Ksin(.theta..+-..pi./2)), which has a phase difference of 90.degree. from the A-phase signal, and obtains angle data (.theta.) by carrying out interpolative computation with use of these two sine-wave signals, thereby improving the resolution for the position and speed.
There are known methods for this interpolation technique, including a method in which a converter circuit for sine- and cosine-wave signals from a signal source is composed of a plurality of resistors and comparator arrays. In another method based on the interpolation circuit configuration shown in FIG. 15, a sine-wave signal V.sub.A and a cosine-wave signal V.sub.B are inputted to the interpolative computation unit 2 after being A/D-converted by unit of A/D converters 1a and 2a, respectively, and the interpolative computation unit 2 computes tan.sup.-1 (V.sub.A /V.sub.B) to obtain angle data .theta.. The computation of this inverse transform of a tangent can be carried out by using a calculation process based on a Taylor expansion, for example.
An interpolation circuit used for a conventional encoder carries out interpolative computation on the assumption that it receives an A-phase signal (sine-wave signal) and a B-phase signal (cosine-wave signal) that are equal in amplitude K and have a phase difference of .pi./2.
In general, however, A- and B-phase signals that are inputted to an encoder do not always have an accurate phase difference of .pi./2, and are not always equal in amplitude. In other words, the phase difference between the two signals may be deviated from .pi./2 or the amplitude ratio may be deviated from 1.
If interpolative computation is carried out with use of these deviated signals, the obtained angle .theta. may possibly be subject to an interpolation error attributable to the deviation.
Conventionally, therefore, this interpolation error is removed by a method in which an analog regulator circuit is provided in front of A/D converters so that the amplitude ratio between the A- and B-phase signals inputted to the analog regulator circuit can be adjusted to 1 or that phase difference between the A- and B-phase signals can be adjusted to .pi./2.
However, the removal of the interpolation error by means of the analog regulator circuit requires a complicated circuit configuration. Since the regulator circuit is an analog circuit, moreover, it is necessary to adjust the regulator circuit itself.